E - This parameter is a generic for the type of elements that will be stored in the hash table.
Please note that all elements must implement the KeyedElement interface.
If the elements, themselves, do not implement the KeyedElement interface,
a super-class of element must implement the KeyedElement interface.K - This parameter is a generic for the type of key each element must have.public interface HashTableInterface<E extends KeyedElementInterface<K>,K>
extends java.lang.Iterable<E>
| Modifier and Type | Method and Description |
|---|---|
E |
get(K key)
This method is used to retrieve an element with the specified key from the
hash table.
|
double |
getAverageBucketSize()
This method will look at all the buckets in the HashTable and return the average
size of all the buckets.
|
LinkedList<E,K>[] |
getBuckets()
This method will be used for testing purposes.
|
int |
getSizeOfLargestBucket()
This method will look at all the buckets in the HashTable and return the size
of the largest bucket.
|
E |
insert(E element)
This method adds the specified element to the hash table.
|
boolean |
isEmpty()
This method is used to determine if the hash table is empty.
|
E |
remove(K key)
This method will remove the element with the specified key from the hash table.
|
void |
removeAll()
This method will remove all elements from the hash table, leaving an empty hash table.
|
int |
size()
This method will return the size of the hash table.
|
int size()
boolean isEmpty()
E insert(E element)
element - The element to be inserted into the hash tableE get(K key)
key - The key of the element being searched for in the hash tableE remove(K key)
key - The key of the element to be removed from the hash table.void removeAll()
int getSizeOfLargestBucket()
double getAverageBucketSize()